Like room_change, but also carries target - an existing instance, or nothing - into room r, places it at (x, y) - a spot in room r, counted from that room’s top-left corner - the instant the transition’s hidden LOAD runs, and plays transition instead of r’s own default. “Should work like teleporters already do.”
Works differently on Game Boy - On the Game Boy a fade goes through the 4 shades (every shade a step toward black or white, so it has few looks), and a wipe is drawn in black blocks of 8 by 8 pixels with the sprites hidden under it.
Works differently on Game Boy Color - The Game Boy Color plays every transition the Advance has. The wipes are drawn in blocks of 8 by 8 pixels, the mosaic is only the fade to black it ends in, and a color you change by hand during a fade shows unfaded until it ends.
On other consoles this differs: see Side by side and How the consoles differ.
room_change_ext(r, target, x, y, transition)| Name | Type |
|---|---|
r | room |
target | ref<object> |
x | real |
y | real |
transition | transition |
Nothing.
Like room_change, but also carries target - an existing instance, or nothing - into room r, places it at (x, y) the instant the transition's hidden LOAD instant runs, and plays transition instead of r's own default. "Should work like teleporters already do."
x and y are a place in room r, the room you are going to, counted from that room's top-left corner - not from the room you are leaving. (0, 0) is the destination's top-left corner, so its middle is (room_width_of(r) / 2, room_height_of(r) / 2).
target does not need to already be persistent - it is carried for exactly this one crossing, and its own persistent flag is restored right afterward, never left on permanently. A stale reference or nothing simply carries nothing (x/y are then unused), the same "clamp, do not crash" posture room_change already has for an out-of-range room.
transition is a closed vocabulary, never an ordinary value: a kind on its own (fade_to_black, iris, diamond, mosaic, instant_cut, ...) or kind.direction for one of the five directional kinds - wavy_wipe.north/.east/.south/.west, diagonal_wipe.northeast/.southeast/.southwest/.northwest, and venetian_blinds/comb/barn_doors the same way wavy_wipe does. Omitting the direction, or writing kind.auto, plays it in the direction of travel - which for this call is always SOUTH at the engine level, so auto is always South-derived, never meaningless.
Multiple doors on one wall, each its own transition. transition can also be self.<name> or other.<name>, naming a variable of type transition that an object has - "this instance's own transition," resolved per PLACED instance rather than shared by every instance of the object. The objects that have one are the doors the Room Editor makes: each has a send_transition, chosen in that one door's own dialog. Two doors in the same room can each play something different - one fade_to_black, another wavy_wipe.north - both reached from the exact same script line, room_change_ext(r, self, x, y, self.send_transition). A door with nothing chosen inherits whichever room it is placed into's own transition_on_exit - the same "the room being left chooses it" rule room_change's own one-argument form already follows. A transition-typed variable is never an ordinary value either: it cannot be read, assigned, or compared outside this exact self.<name>/other.<name> position, and code cannot make a new one.
room_change_ext(room_doc_arena, self, 100, 80, wavy_wipe.north);Carries this instance into room_doc_arena and places it at (100, 80), leaving with a wavy wipe sweeping north - the shape a project's own teleporter or "boss door" object would use to move the instance that triggered it to a specific spot in the next room.
room_change_ext(room_doc_arena, nothing, 0, 0, fade_to_black);Starts the same transition to room_doc_arena, but carries nothing - every non-persistent instance in the room being left is cleared exactly as room_change already does, and (0, 0)/the carried instance are irrelevant. Useful when only the transition itself needs to be chosen - a plain fade to black here, rather than whatever room_doc_arena's own door settings would otherwise have picked.
target does not need to already be persistent - it is carried for exactly this one crossing and its own persistent flag is restored right afterward, never left on permanently. A stale reference or nothing simply carries nothing (x/y then unused), the same “clamp, do not crash” posture room_change already has for an out-of-range room. transition is a closed vocabulary, never an ordinary value: a kind on its own (fade_to_black, iris, diamond, mosaic, ...) or kind.direction for one of the five directional kinds (wavy_wipe.north, diagonal_wipe.northeast, and venetian_blinds/comb/barn_doors the same way) - omitting the direction, or writing kind.auto, plays it in the direction of travel, which for this call is always SOUTH at the engine level (so auto is always South-derived, never meaningless). focus is not selectable yet - every kind here uses the engine’s own AUTO focus (screen center), already every effect’s own default.